package com.atguigu.bean;

import org.springframework.beans.factory.annotation.Value;

/**
 * @author Honglixi
 * @create 2021-03-26 13:14
 */
public class Person {
    /*
    使用value赋值
    1.基本数值 2.可以写spEL:#{}
    3.可以写${}:取出配置文件【properties】中的值(在运行环境变量里面的值)
     */
    @Value("张三")
    private String name;
    @Value("#{99-66}")
    private Integer age;
    @Value("${person.nickName}")
    private String nickname;

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Person(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public Person() {
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", nickname='" + nickname + '\'' +
                '}';
    }
}
